package com.service.test;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DynamicProxy implements InvocationHandler {

	private Object target;
	
	public DynamicProxy(Object target) {
		this.target = target;
	}
	
	@Override
	public Object invoke(Object arg0, Method arg1, Object[] arg2)
			throws Throwable {
		
		System.out.println("method:" + arg1.getName());
		Object result = arg1.invoke(this.target, arg2);
		return result;
	}

}
